<?php

namespace app\mall\ui\table;

use app\mall\enum\OrderStatusEnum;
use suframe\thinkAdmin\ui\table\TableInterface;

/**
 * 订单管理表格
 */
class MallOrderTable extends TableInterface
{
    public function header()
    {
        return [
            'id' => ['label' => 'ID', 'sort' => true, 'fixed' => 'left', 'width' => 80],
            'user_nickname' => ['label' => '买家', 'width' => 120],
            'goods_title' => ['label' => '商品'],
            'store_name' => ['label' => '门店'],
            'sn' => ['label' => '订单号'],
            'status_text' => ['label' => '订单号', 'width' => 80, 'field' => 'status', 'filter' => OrderStatusEnum::toZhArray()],
            'money' => ['label' => '支付金额'],
            'create_time' => ['label' => '下单时间', 'width' => 160],
        ];
    }

    public function filters()
    {
        return [
            'sn' => ['label' => '订单号', 'type' => 'text'],
            'uid' => ['label' => '会员UID', 'type' => 'text'],
            'goods_id' => ['label' => '商品id', 'type' => 'text'],
            'store_id' => ['label' => '门店id', 'type' => 'text'],
            'create_time' => ['label' => '下单时间', 'type' => 'daterange'],
        ];
    }
}